From: Derick Alangi Date: Wed, 20 Mar 2019 20:00:03 +0000 (+0100) Subject: collation: Use `self` to reference same class instead of class name X-Git-Tag: 1.34.0-rc.0~2436^2 X-Git-Url: http://git.cyclocoop.org//%22http:/%22.attribut_html%28%24lesurls%5B%24numero%5D%29.%22/%22?a=commitdiff_plain;h=9e8f5c3067e52b3f73ba4abe191be8606b12c59c;p=lhc%2Fweb%2Fwiklou.git collation: Use `self` to reference same class instead of class name With the use of `self`, even if the class name is changed (which is very unlikely), then the code won't break. So it's a way of future proofing the code. Change-Id: Ib4046315b8aaee2e77af036893924962d25ceeb1 --- diff --git a/includes/collation/Collation.php b/includes/collation/Collation.php index ab3c6fb432..312c2d438c 100644 --- a/includes/collation/Collation.php +++ b/includes/collation/Collation.php @@ -76,7 +76,7 @@ abstract class Collation { $collationObject = null; Hooks::run( 'Collation::factory', [ $collationName, &$collationObject ] ); - if ( $collationObject instanceof Collation ) { + if ( $collationObject instanceof self ) { return $collationObject; }